﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/Layouts/Admin.Master" AutoEventWireup="true"
    CodeBehind="ProductCategoryMananger.aspx.cs" Inherits="MLM.AdminCP.Pages.ProductCategoryMananger" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="lbName" runat="server" Text="Product Category Management" 
        meta:resourcekey="lbNameResource1"></asp:Label> 
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <telerik:RadGrid ID="RadProductCategoryGrid" runat="server" AllowFilteringByColumn="True"
        DataSourceID="GroupProductCategoryEds" AllowPaging="True" AllowSorting="True"
        GridLines="None" ShowGroupPanel="True"   AllowAutomaticInserts="True"
        AllowAutomaticUpdates="True" AllowAutomaticDeletes="True" 
        ShowFooter="True" ShowStatusBar="True" 
        meta:resourcekey="RadProductCategoryGridResource1">
        <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True">
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="ProductCategoryID" DataSourceID="GroupProductCategoryEds"
            ShowHeader="true" ShowHeadersWhenNoRecords="true" AllowAutomaticInserts="true"
            CommandItemDisplay="TopAndBottom">
            <%--<MasterTableView ShowFooter="false" DataKeyNames="ProductID" EditMode="InPlace" CommandItemDisplay="TopAndBottom">--%>
            <CommandItemSettings ShowAddNewRecordButton="true" ShowRefreshButton="true">
                <%--ExportToPdfText="Export to Pdf">--%></CommandItemSettings>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="ProductCategoryID" DataType="System.Int64" HeaderText="ProductCategoryID"
                    ReadOnly="True" SortExpression="ProductCategoryID" 
                    UniqueName="ProductCategoryID" meta:resourcekey="GridBoundColumnResource1">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name"
                    UniqueName="Name" meta:resourcekey="GridBoundColumnResource2">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="SortOrder" HeaderText="SortOrder" SortExpression="SortOrder"
                    UniqueName="SortOrder" DataType="System.Int64" 
                    meta:resourcekey="GridBoundColumnResource3">
                </telerik:GridBoundColumn>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" 
                    UniqueName="EditCommandColumn" 
                    meta:resourcekey="GridEditCommandColumnResource1">
                    <ItemStyle CssClass="MyImageButton"></ItemStyle>
                </telerik:GridEditCommandColumn>
                <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn" meta:resourcekey="GridButtonColumnResource1">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton"></ItemStyle>
                </telerik:GridButtonColumn>
                <%--Them edit vao bang --FooterText="EditCommand footer"--%>
                <%--Them edit vao bang --FooterText="EditCommand footer"--%>
            </Columns>
            <EditFormSettings EditFormType="Template">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
                <FormTemplate>
                    <table id="Table2" style="border-collapse: collapse; padding-left: 20">
                        <tr class="EditFormHeader" style="height: 30">
                            <td style="font-size: small" colspan="2">
                                 <b> <asp:Label ID="Label1" runat="server" Text="Product Category Information" 
                                     meta:resourcekey="Label1Resource1"></asp:Label></b>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="titlename">
                                <asp:Label ID="lbName" runat="server" Text="Name:" 
                                    meta:resourcekey="lbNameResource2"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox1" runat="server" 
                                    Text='<%# Bind("Name") %>' LabelCssClass="" 
                                    meta:resourcekey="RadTextBox1Resource1">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="TextBoxRequiredFieldValidator" runat="server" Display="Dynamic"
                                    ControlToValidate="RadTextBox1" ErrorMessage="The Name can not be empty!" 
                                    meta:resourcekey="TextBoxRequiredFieldValidatorResource1"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr style="height: 30px">
                            <td class="titlename">
                                <asp:Label ID="lbSortOrder" runat="server" Text="SortOrder:" 
                                    meta:resourcekey="lbSortOrderResource1"></asp:Label>
                            </td>
                            <td style="width: 30">
                                <telerik:RadTextBox CssClass="radtextbox" ID="RadTextBox2" runat="server" 
                                    Text='<%# Bind("SortOrder") %>' LabelCssClass="" 
                                    meta:resourcekey="RadTextBox2Resource1">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic"
                                    ControlToValidate="RadTextBox2" 
                                    ErrorMessage="The textbox can not be empty!" 
                                    meta:resourcekey="RequiredFieldValidator1Resource1"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td style="padding-bottom: 10; padding-top: 10" colspan="2">
                                <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" 
                                    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' 
                                    meta:resourcekey="btnUpdateResource1">
                                </asp:Button>&nbsp;
                                <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                    CommandName="Cancel" meta:resourcekey="btnCancelResource1"></asp:Button>
                            </td>
                        </tr>
                    </table>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <%-- <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default">
        </HeaderContextMenu>--%>
        <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Office2007">
        </HeaderContextMenu>
    </telerik:RadGrid>
    <asp:EntityDataSource ID="GroupProductCategoryEds" runat="server" ConnectionString="name=MLMDataContext"
        DefaultContainerName="MLMDataContext" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="ProductCategories">
    </asp:EntityDataSource>
</asp:Content>
<%--<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" runat="server">
</asp:Content>--%>
